home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Pdmod / modules / socket / netdb.m < prev    next >
Encoding:
Text File  |  2002-10-28  |  3.2 KB  |  85 lines

  1. /*
  2.  * $Id: netdb.h,v 1.11 1994/04/03 23:41:20 jraja Exp $
  3.  *
  4.  * Network Database Structures and Defintions
  5.  *
  6.  * Copyright © 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  7.  *                  Helsinki University of Technology, Finland.
  8.  *                  All rights reserved.
  9.  */
  10.  
  11. /*-
  12.  * Copyright (c) 1980, 1983, 1988 Regents of the University of California.
  13.  * All rights reserved.
  14.  *
  15.  * Redistribution and use in source and binary forms are permitted
  16.  * provided that: (1) source distributions retain this entire copyright
  17.  * notice and comment, and (2) distributions including binaries display
  18.  * the following acknowledgement:  ``This product includes software
  19.  * developed by the University of California, Berkeley and its contributors''
  20.  * in the documentation or other materials provided with the distribution
  21.  * and in all advertising materials mentioning features or use of this
  22.  * software. Neither the name of the University nor the names of its
  23.  * contributors may be used to endorse or promote products derived
  24.  * from this software without specific prior written permission.
  25.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  26.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  28.  */
  29.  
  30. #define _PATH_DB            'AmiTCP:db'
  31. #define _PATH_AMITCP_CONFIG 'AmiTCP:db/AmiTCP.config'
  32. #define _PATH_NETDB         'AmiTCP:db/netdb'
  33. #define _PATH_HEQUIV        'AmiTCP:db/hosts.equiv'
  34. #define _PATH_INETDCONF     'AmiTCP:db/inetd.conf'
  35.  
  36. /*
  37.  * Structures returned by network data base library.  All addresses are
  38.  * supplied in host order, and returned in network order (suitable for
  39.  * use in system calls).
  40.  */
  41. OBJECT hostent
  42.     h_name:PTR TO BYTE,              /* official name of host */
  43.     h_aliases:PTR TO PTR TO BYTE,    /* alias list */
  44.     h_addrtype:LONG,                 /* host address type */
  45.     h_length:LONG,                   /* length of address */
  46.     h_addr_list:PTR TO PTR TO BYTE   /* list of addresses from name server */
  47.  
  48.  
  49. /*
  50.  * Assumption here is that a network number
  51.  * fits in 32 bits -- probably a poor one.
  52.  */
  53. OBJECT netent
  54.     n_name:PTR TO BYTE,           /* official name of net */
  55.     n_aliases:PTR TO PTR TO BYTE, /* alias list */
  56.     n_addrtype:LONG,              /* net address type */
  57.     n_net:ULONG                   /* network # */
  58.  
  59.  
  60. OBJECT servent
  61.     s_name:PTR TO BYTE,            /* official service name */
  62.     s_aliases:PTR TO PTR TO BYTE,  /* alias list */
  63.     s_port:LONG,                   /* port # */
  64.     s_proto:PTR TO BYTE            /* protocol to use */
  65.  
  66.  
  67. OBJECT protoent
  68.     p_name:PTR TO BYTE,             /* official protocol name */
  69.     p_aliases:PTR TO PTR TO BYTE,    /* alias list */
  70.     p_proto:LONG                    /* protocol # */
  71.  
  72.  
  73. /*
  74.  * Error return codes from gethostbyname() and gethostbyaddr()
  75.  * (left in extern int h_errno).
  76.  */
  77.  
  78. #define HOST_NOT_FOUND  1         /* Authoritative Answer Host not found */
  79. #define TRY_AGAIN       2         /* Non-Authoritive Host not found, or SERVERFAIL */
  80. #define NO_RECOVERY     3         /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  81. #define NO_DATA         4         /* Valid name, no data record of requested type */
  82. #define NO_ADDRESS      NO_DATA   /* no address, look for MX record */
  83.  
  84.  
  85.